<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>布局1</title>
    <style>
        .box{
            
            display: flex;
            width: 400px;
            height: 200px;
            border: 2px solid red;
            flex-direction: column;
            /* 元素排列的方向就是主轴
                另一个方向就是副轴
                主轴：justify-content
                副轴：align-items
                小游戏：https://flexboxfroggy.com/
            */
            justify-content:flex-start;
            align-items: center;
        }
        
        .div1{
            /* position: absolute; */
            width: 80px;
            height: 100px;
            background-color: red;
            /* float: left; */
        }
        .div2{
            
            /* position: absolute; */
            width: 150px;
            height: 80px;
            background-color: blue;
            /* float: right; */
        }
        
    </style>
</head>
<body>
    <div class="box">
        <div class="div1"></div>
        <div class="div2"></div>
    </div>
</body>
</html>